package com.project.service.lmpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.UserBean;
import com.project.mapper.IUserMapper;
import com.project.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class IUserServiceImpl implements IUserService {

    @Autowired
    private IUserMapper mapper;

    @Override
    public PageInfo<UserBean> findAll(int pageNo) {
        PageHelper.startPage(pageNo,3);
        PageInfo<UserBean>pageInfo=PageInfo.of(mapper.findAll());
        return pageInfo;
    }

    @Override
    public void add(UserBean user) {
        mapper.add(user);
    }
}
